﻿<?xml version="1.0" encoding="utf-8" ?>
<AdoNetDataAccess connection="$SyrinxDBConnection$" formatter="bizobj of TreeNode">
	<Sql>
    SELECT
    t.id, t.objectId, t.parentId, t.parentHostId,
    c.rootId, c.name, c.keyName, c.depth, c.treeName,
    c.totalL1 AS counts_totalL1, c.totalL2 AS counts_totalL2, c.totalL3 AS counts_totalL3, c.totalL4 AS counts_totalL4
    FROM
    ObjectTreeNodes as t
    LEFT OUTER JOIN ObjectTreeCounts as c on c.objectId = t.objectId
    WHERE
    t.objectId=@id AND t.parentHostId=t.id
  </Sql>
	<Param name="id" type="UniqueIdentifier"/>
</AdoNetDataAccess>